home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_084 / audiotools / test.the.examples < prev    next >
Text File  |  1992-05-06  |  3KB  |  70 lines

  1. A FEW MORE DETAILS
  2. ------------------
  3.  
  4. Starting The Program:
  5.  
  6. When you have compiled the routines using the instructions in COMPILING,
  7. you have a program that must be started from a CLI.  Assuming you have
  8. compiled it from RAM:
  9.  
  10.     1> run ram:audiotools
  11.  
  12. I have deliberately defined the DEBUG variable so that you can see
  13. what the program is doing internally.  Of particular interest is the
  14. multitasking that is visible once the notes begin to play.  That is,
  15. as the notes are being retrieved from the note queue, your task is
  16. busy freeing any I/O request blocks that are returned from the
  17. audio device.  Thus the device and your task are both running
  18. at the same time.
  19.  
  20. About Errors:
  21. -------------
  22. The error value, no matter what is created in an internal routine, is
  23. converted to a zero or nonzero error value, depending on whether there is
  24. no error (0), or some error (nonzero, usually set to -1).  You may have
  25. some other preference about passing back the actual error value.  That
  26. is up to you.
  27.  
  28.  
  29. About the ExtIO data structure:
  30. -------------------------------
  31. For the next release, it will most likely remain identical to 
  32. IOAudio.   I've been thinking about how to implement the message
  33. and priority features I specified in the article and can state
  34. my plans for this feature:
  35.  
  36.        Continue to bury the details of message packet creation
  37.        in my own routines.  Instead of "Message", this field
  38.        should be "MsgPort".  
  39.  
  40.        a. MY routines set up the audio device
  41.           communications and IOAudio; 
  42.  
  43.        b. audio device tells ME when it 
  44.           starts to play a queued note; 
  45.  
  46.        c. MY routine allocates memory for a message block, 
  47.           sends it to the user's MsgPort with the priority 
  48.           field value as the identifier when this note
  49.           begins to play; 
  50.  
  51.        d. User replies to the message, and MY routines free 
  52.           the memory the message used.   The user need only 
  53.           know how to retrieve and reply to messages and 
  54.           needs no knowhow about proper setup of audio device
  55.           or about memory allocation for messages.  Consistent
  56.           with other routines in this audio library.
  57.  
  58.           (Going one step further, InitAudio() could return to
  59.            the user the address of the message port that he'd
  60.            use to retrieve messages about notes beginning, then
  61.            FinishAudio() could free that port.  Small change but
  62.            may help casual user.)
  63.  
  64.            Yes, that's what we'll do.  Have InitAudio() return
  65.            the address of a newly created MsgPort, then the user
  66.            will not have to specify a message, or a MsgPort address
  67.            in the call.  The value of the priority field will be
  68.            sufficient to say whether to send a message or not!
  69.  
  70.